<%@ page language="java" contentType="text/html; charset=UTF-8"
         pageEncoding="UTF-8"%>
<html>
<head>
    <meta charset="UTF-8">
    <title>统计网页访问次数</title>
</head>
<body>
<%

//从session对象中获取number
    Integer number=(Integer)session.getAttribute("number");
    number=number==null?1:number+1;
    session.setAttribute("number",number);
%>

<br>
<div align="center">
    <table>
        <tr>
            <th>第<%=number %>个用户访问本站</th>
            <th>ID:<%=session.getId() %></th>
            <th>有效时间：<%=session.getMaxInactiveInterval()%></th>
            <br>
            <th>刷新时间：<%=session.getLastAccessedTime()%></th>
        </tr>
    </table>
</div>
</body>
</html>
